﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HelpObject.Code
{
    public partial class CodeCreate : Form
    {
        public CodeCreate()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            /// <summary>
            /// 插销最大行程
            /// </summary>
   // public static CommunicateEntity Macro50031 { get; } = new CommunicateEntity(50031, "插销最大行程", CommunicateVariableType.MacroVariable);
            string code = "/// <summary>\r\n";
            code += "///" + textBox2.Text + "\r\n";
            code += "/// </summary>\r\n";
            string type = "";
            if (checkBox1.Checked)
            {
                type = checkBox1.Text;
            }
            if (checkBox2.Checked)
            {
                type = checkBox2.Text;
            }
            if (checkBox3.Checked)
            {
                type = checkBox3.Text;
            }
            if (checkBox4.Checked)
            {
                type = checkBox4.Text;
            }
            code += $"public static CommunicateEntity {type}{textBox1.Text} {{ get; }} = new CommunicateEntity({textBox1.Text}, \"{textBox2.Text}\", CommunicateVariableType.{type});";
            richTextBox1.Text = code;
        }
    }
}
